<?php

class Student_Model_DbTable_Lession extends Zend_Db_Table_Abstract
{

    protected $_name = 'lessions';

    public function getAllLession(){
    	return $this->fetchAll();
    }
    
    public function getLessionByID($lessionID){
    	return $this->fetchRow("lession_id = $lessionID");
    }
    
    public function addLession($leName,$video,$desc,$teacherID,$skill){
    	$data = array(
    			"lession_name"=>$leName,
    			"video"=>$video,
    			"description"=>$desc,
    			"teacher_id"=>$teacherID,
    			"skill"=>$skill,
    			"status"=>0
    			);
    	return $this->insert($data);
    }
    
    public function updateLession($lessionID,$leName,$video,$desc,$teacherID,$skill){
    	$data = array(
    			"lession_name"=>$leName,
    			"video"=>$video,
    			"description"=>$desc,
    			"teacher_id"=>$teacherID,
    			"skill"=>$skill,
    			"status"=>0
    			);
    	return $this->update($data, "lession_id = $lessionID");
    }

}

